const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const vueLoaderPlugin = require('vue-loader/lib/plugin-webpack4');


module.exports = {
    mode: 'development',
    entry: path.resolve(__dirname, './src/pages/main.js'),
    output: {
        filename: 'pages/[name].js',
        path: path.resolve(__dirname, 'dist')
    },
    plugins: [
        new vueLoaderPlugin(),
        new htmlWebpackPlugin({
            template: path.resolve(__dirname, './src/pages/index.html'),
            filename: 'pages/index.html'
        })
    ],
    module: {
        rules: [
            {
                test: /\.js$/,
                use: 'babel-loader',
                exclude: /node_modules/
            },
            {
                test: /\.vue$/,
                use: 'vue-loader'
            }
        ]
    }
}